<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <title> Data Barang</title>
        <meta charset="UTF-8">
        <link href="<?php echo base_url(); ?>css/bootstrap.min.css" rel="stylesheet" media="screen"/>
        <script type="text/javascript" src="<?php echo base_url(); ?>js/jquery-1.8.3.min.js"></script>
        <style type="text/css">
            .no{
                width: 19px;
                height: 20px;
                background-image: url(<?php echo base_url('img/y.png'); ?>);
                background-position: 19px 0px;
            }
            .yes{
                width: 20px;
                height: 20px;
                background-image: url(<?php echo base_url('img/y.png'); ?>);
                background-position: 0px 0px;
            }
            input, .no, .yes{
                display: inline-block;
            }
        </style>
    </head>
    <body>

        <div id="form_input" title="Input / Edit Data">
            <table>
                <?php echo validation_errors(); ?>
                <?php echo form_open('pegawai1/submit'); ?>
                <tr >
                
                <td><input type="hidden" value='' id="id" name="id" /> <?php echo form_label('Job Order : '); ?></td>
                <td> <?php echo form_input('job_order', set_value('job_order'), 'id="nama"'); ?><div class="yes nama"></div><div class="no nama"></div></td>
                </tr>
                <tr >
                    <td> <?php echo form_label('Consgnee : '); ?></td>
                    <td> <?php echo form_input('consgnee', set_value('consgnee'), 'id="consgnee"'); ?></td>
                </tr>
                <tr>
                    <td> <?php echo form_label('Origin : '); ?> </td>
                    <td> <?php echo form_input('origin', set_value('origin'), 'id="origin"'); ?></td>
                </tr>
                <tr>
                    <td> <?php echo form_label('Shipper : '); ?> </td>
                    <td> <?php echo form_input('shipper', set_value('shipper'), 'id="shipper"'); ?></td>
                </tr>
                <tr >
                    <td> <?php echo form_label('Via : '); ?></td>
                    <td> <select name="via">
                            <option value="SF">SF</option>
                            <option value="AF">AF</option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td> <?php echo form_label('Agent : '); ?> </td>
                    <td> <?php echo form_input('agent', set_value('agent'), 'id="agent"'); ?></td>
                </tr>
                <tr>
                    <td> <?php echo form_label('Ctn : '); ?> </td>
                    <td> <?php echo form_input('ctn', set_value('ctn'), 'id="ctn"'); ?></td>
                </tr>
                <tr>
                    <td> <?php echo form_label('Kg : '); ?> </td>
                    <td> <?php echo form_input('kg', set_value('kg'), 'id="kg"'); ?></td>
                </tr>
                <tr>
                    <td> <?php echo form_label('M3 : '); ?> </td>
                    <td> <?php echo form_input('m3', set_value('m3'), 'id="m3"'); ?></td>
                </tr>
                <tr>
                    <td> <?php echo form_label('Description : '); ?> </td>
                    <td> <?php echo form_textarea('description', set_value('description'), 'id="description"'); ?></td>
                </tr>
                <tr>
                    <td> <?php echo form_label('Penerimaan : '); ?> </td>
                    <td> <?php echo form_input('penerimaan', set_value('penerimaan'), 'id="penerimaan"'); ?></td>
                </tr>
                <tr>
                    <td> <?php echo form_label('Cost : '); ?> </td>
                    <td> <?php echo form_input('cost', set_value('cost'), 'id="cost"'); ?></td>
                </tr>
                <tr>
                    <td> <?php echo form_label('Remarks : '); ?> </td>
                    <td> <?php echo form_textarea('remarks', set_value('remarks'), 'id="remarks"'); ?></td>
                </tr>
                <tr>
                    <td><?php echo form_submit('submit', 'Save', 'id="submit" class="btn btn-primary"') ?>
                </tr>
            </table>
        </div>
        <script type="text/javascript">
            $(document).ready(function(){
            $('.nama').hide();
            
            $('#nama').blur(function(){
                if($(this).val() == ""){
                    $('.nama').fadeOut("slow");
                }else{
                    $.post("<?php echo site_url('pegawai1/cek_order'); ?>", { q:$(this).val() }, function(data){
                        if(data == 0){
                            $('.nama.no').hide();
                            $('.nama.yes').fadeIn("slow");
                            disn = 1;
                        }else{
                            $('.nama.yes').hide();
                            $('.nama.no').fadeIn("slow");
                            disn = 0;
                        }
                    });
                }
            });
        });
        </script>
    </body>
</html>